﻿namespace KingerRobot.MexicoSailunWMS.Spi;
public interface IOutOrderService
{
    /// <summary>
    /// 根据库位创建出库单
    /// </summary>
    /// <param name="loc">库位ID</param>
    /// <returns></returns>
    string CreateOutOrder(CreateOrderParm order);
    /// <summary>
    /// 批量创建出库单
    /// </summary>
    /// <param name="parm"></param>
    /// <param name="userId"></param>
    /// <param name="userName"></param>
    /// <param name="clientip"></param>
    /// <returns></returns>
    string CreateOutOrders(CreateOrderParms parm, long userId, string userName, string clientHost);
    /// <summary>
    /// 查询
    /// </summary>
    /// <param name="parm">单号；类别</param>
    List<OrderMastersBean> GetOutOrder(OrderParm parm);
    /// <summary>
    /// 修改订单状态
    /// </summary>
    /// <param name="parm">订单ID；状态；</param>
    /// <returns></returns>
    int UpdateOrderStatus(OrderStatusParm parm);


    int GetOutOrderDetails(long summaryId);

    /// <summary>
    /// 
    /// </summary>
    /// <param name="masterId"></param>
    /// <returns></returns>
    orderMasterBean GetOutOrderDetailsByMasterId(long masterId);
    /// <summary>
    /// 硫化拉动明细表
    /// </summary>
    /// <returns></returns>
    List<CuringOutOrderBean> GetCuringOutOrderDetails(CuringOutOrderParm parm);

}

public class CuringOutOrderBean
{
    /// <summary>
    /// 硫化机台
    /// </summary>
    public string EquipNo { get; set; }
    /// <summary>
    /// 左右模
    /// </summary>
    public string EquipModel { get; set; }
    /// <summary>
    /// 在硫化品规格
    /// </summary>
    public string MaterialCode { get; set; }
    /// <summary>
    /// 硫化工艺时间(秒)
    /// </summary>
    public int? CuringTotalTime { get; set; }
    /// <summary>
    /// mes邀请订单号
    /// </summary>
    public string MesOrderId { get; set; }
    /// <summary>
    /// 订单状态
    /// </summary>
    public string OrderStatus { get; set; }
    /// <summary>
    /// mes邀请时间
    /// </summary>
    public DateTime? MesCreateTime { get; set; }
    /// <summary>
    /// mes要求最晚送达时间
    /// </summary>
    public DateTime? MesLatestTime { get; set; }
    /// <summary>
    /// 任务生成时间
    /// </summary>
    public DateTime? TaskCreateTime { get; set; }




}

public class CuringOutOrderParm 
{

    /// <summary>
    /// 硫化机台
    /// </summary>
    public string EquipNo { get; set; }
    /// <summary>
    /// 在硫化品规格
    /// </summary>
    public string MaterialCode { get; set; }
    /// <summary>
    /// 订单状态
    /// </summary>
    public string OrderStatus { get; set; }
}

public class CreateOrderParm
{
    public long loc { get; set; }
}
public class CreateOrderParms
{
    public List<long> locs { get; set; }
    /// <summary>
    /// 1：立库异常出库；2：线体异常出库
    /// </summary>
    public string outType { get; set; }
}
public class OrderParm
{
    /// <summary>
    /// 单号
    /// </summary>
    public string OrderCode { get; set; }
    /// <summary>
    /// 类型
    /// </summary>
    public string OrderType { get; set; }
    /// <summary>
    /// 目标货位编号
    /// </summary>
    public string TargetLocCode { get; set; }


    public string TargetLocName { get; set; }

}

public class OrderMastersBean
{
    /// <summary>
    /// 订单ID
    /// </summary>
    public long OrderId { get; set; }
    /// <summary>
    /// 订单编号
    /// </summary>
    public string OrderCode { get; set; }
    /// <summary>
    /// 订单类别
    /// </summary>
    public int OrderType { get; set; }
    /// <summary>
    /// 订单类别描述
    /// </summary>
    public string OrderTypeDesc { get; set; }
    /// <summary>
    /// 目标货位
    /// </summary>
    public string TargetLocName { get; set; }
    /// <summary>
    /// 目标货位编号
    /// </summary>
    public string TargetLocCode { get; set; }
    /// <summary>
    /// 目标货位
    /// </summary>
    public long? TargetLoc { get; set; }
    /// <summary>
    /// 订单状态
    /// </summary>
    public int OrderStatus { get; set; }
    /// <summary>
    /// 订单状态描述
    /// </summary>
    public string OrderStatusDesc { get; set; }
    /// <summary>
    /// 订单优先级
    /// </summary>
    public int OrderPriority { get; set; }
    /// <summary>
    /// 订单优先级
    /// </summary>
    public DateTime CreateTime { get; set; }
    /// <summary>
    /// 计划请料数量
    /// </summary>
    public int? PlanCount { get; set; }
    /// <summary>
    /// 实际请料数量
    /// </summary>
    public int? RealCount { get; set; }
    /// <summary>
    /// 备注
    /// </summary>
    public string Remark { get; set; }
}
public class OrderStatusParm
{
    /// <summary>
    /// 订单ID
    /// </summary>
    public long OrderId { get; set; }
    /// <summary>
    /// 状态
    /// </summary>
    public int Status { get; set; }
}

public class orderMasterBean
{
    public long MasterId { get; set; }
    public long LeftSummaryId { get; set; }
    public long RightSummaryId { get; set; }
    public string LeftMaterialCode { get; set; }
    public string RightMaterialCode { get; set; }
}

public class orderSummaryBean
{

    public long MasterId { get; set; }

    public long SummaryId { get; set; }

    public string StartLoc { get; set; }

    public string TargetLoc { get; set; }

    public string MaterialCode { get; set; }

    public string BarCode { get; set; }

    public long TaskNo { get; set; }
    public DateTime CreateTime { get; set; }

    public string LocName1 { get; set; }
    public string LocName2 { get; set; }
    public string LocName3 { get; set; }
    public string LocName4 { get; set; }


    public DateTime StartTime1 { get; set; }
    public DateTime StartTime2 { get; set; }
    public DateTime StartTime3 { get; set; }
    public DateTime StartTime4 { get; set; }

    public DateTime EndTime1 { get; set; }
    public DateTime EndTime2 { get; set; }
    public DateTime EndTime3 { get; set; }
    public DateTime EndTime4 { get; set; }

}


#region 出库订单追踪看板类


/// <summary>
/// 出库订单追踪看板类
/// </summary>
public class OutOrderKanBan
{
    /// <summary>
    /// 出库单主表ID
    /// 
    /// </summary>
    public long OutOrderMaserId { get; set; }

    /// <summary>
    /// 明细信息
    /// </summary>
    public List<OutOrderSummaryKanBan> Summarys { get; set; }

    /// <summary>
    /// 1级排序
    /// </summary>
    public int Index { get; set; }

    /// <summary>
    /// 出库单创建时间
    /// </summary>
    public DateTime MasterCreateTime { get; set; }

}

/// <summary>
/// 出库订单子表
/// </summary>
public class OutOrderSummaryKanBan
{
    /// <summary>
    /// 子表ID
    /// </summary>
    public long OutOrderSummaryId { get; set; }

    /// <summary>
    /// 左模或者又模
    /// </summary>
    public int LeftOrRight { get; set; }

    /// <summary>
    /// 条码
    /// </summary>
    public string Barcode { get; set; }

    /// <summary>
    /// 规格编号
    /// </summary>
    public string Spec { get; set; }

    /// <summary>
    /// 目标位置
    /// </summary>
    public string TargetLoc { get; set; }

    /// <summary>
    /// 出库位置
    /// </summary>
    public string StartLoc { get; set; }

    /// <summary>
    /// 任务编号
    /// </summary>
    public long TaskId { get; set; }


    /// <summary>
    /// 任务流水号
    /// </summary>
    public int TaskSn { get; set; }

    /// <summary>
    /// 订单创建时间
    /// </summary>
    public DateTime OutOrderTime { get; set; }

    /// <summary>
    /// 实际出库时间
    /// </summary>
    public DateTime OutRealTime { get; set; }

    /// <summary>
    /// 是否已经生成任务
    /// </summary>
    public int IsCreateTask { get; set; }

}


public class OutOrderSchedule
{

    public int Index { get; set; }

    public int IsOver { get; set; }

    public long CmdId { get; set; }

    public DateTime OverTime { get; set; }

    public DateTime CreateTime { get; set; }

}

#endregion



